<?php

/**
 * Orice request ajax este permis doar catre actiunile care incep cu 'x'
 */
class ajaxRequestFilter extends sfFilter
{

    public function execute($filterChain)
    {
        if (stripos($this->getContext()->getActionName(), 'x') !== 0 ||
                $this->getContext()->getRequest()->isXmlHttpRequest())
        {
            $filterChain->execute();
        }
    }

}
